﻿using _220105BookSys.Dto.Book;
using _220105BookSys.Model;
using AutoMapper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace _220105BookSys.api.Profiles
{
    public class BookProfile : Profile
    {
        public BookProfile()
        {
            CreateMap<Book, BookDto>();
            CreateMap<BookDtoForCreatation, Book>().ForMember(destinationMember => destinationMember.Id, memberOptions => memberOptions.MapFrom(sourceMember => Guid.NewGuid()));
        }
    }
}
